package com.admin.themechange

import android.content.Intent
import kotlinx.android.synthetic.main.activity_language.*

/**
 * author 吴昶
 * date 2019/5/29
 * 标注
 */
class LanguageActivity :BaseActivity(){
    override fun bindLayout(): Int {
        return R.layout.activity_language
    }

    override fun bindEvent() {
        btn_chinese.setOnClickListener {
            SharedPreferencesUntil.saveValue("language","ch")
            setLanguage("ch")
            restart()
        }

        btn_english.setOnClickListener {
            SharedPreferencesUntil.saveValue("language","ch")
            setLanguage("en")
            restart()
        }
    }

    fun restart(){
        val intent=Intent(this@LanguageActivity,MainActivity::class.java)
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
        startActivity(intent)
    }



}